<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!--临时查询form表单,可以增加一些分页的查询参数等,如果某一操作触发当前页面刷新,默认情况下提交此form进行查询-->
<form id="pagerForm" method="POST" action="/manage/person/user/query">
    <input type="hidden" name="pageNum" value="1"/><!--【必须】value=1可以写死-->
    <input type="hidden" name="userName" value=""/>
    <input type="hidden" name="serviceURI" value=""/>
</form>

<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" method="POST" action="/manage/person/user/query">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        用户名：<input type="text" name="userName" value="${param.userName}" maxlength="50"/>
                    </td>
                    <td>
                        姓名：<input type="text" name="userFullName" value="${param.userFullName}" maxlength="50"/>
                    </td>
                    <td>
                        用户分类：
                        <select name="userCategory">
                            <option value="">请选择</option>
                            <option value="1" ${param.userCategory eq '1' ? "selected":""}>管理员</option>
                            <option value="2" ${param.userCategory eq '2' ? "selected":""}>运营人员</option>
                        </select>
                    </td>
                    <td><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></td>
                </tr>
            </table>
        </div>
    </form>
</div>

<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                <a class="add" href="/manage/person/user/add" target="dialog" mask="true" rel="person_user_add"
                   title="添加人员">
                    <span>添加人员</span>
                </a>
            </li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH="88">
        <thead>
        <tr>
            <th width="30">序号</th>
            <th width="120">用户名</th>
            <th>email</th>
            <th>姓名</th>
            <th width="100">用户分类</th>
            <th width="150">创建时间</th>
            <th width="150">修改时间</th>
            <th width="100" align="center">创建人</th>
            <th width="80" align="center">操作</th>
        </tr>
        </thead>
        <tbody>

        <c:forEach items="${users}" var="user" varStatus="status">
            <tr target="switch_id" rel="${user.id}">
                <td>${status.index+1}</td>
                <td>${user.userName}</td>
                <td>${user.email}</td>
                <td>${user.userFullName}</td>
                <td>
                    <c:choose>
                        <c:when test="${user.userCategory eq '1'}">
                            管理员
                        </c:when>
                        <c:when test="${user.userCategory eq '2'}">
                            运营人员
                        </c:when>
                        <c:otherwise>
                            其他
                        </c:otherwise>
                    </c:choose>
                </td>
                <td><fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                <td><fmt:formatDate value="${user.modifyTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                <td>${user.createUser}</td>
                <td>
                    <a class="btnDel" href="/manage/person/user/delete/${user.id}" target="ajaxTodo"
                       title="确定要删除吗?">删除</a>
                    <a class="btnEdit" href="/manage/person/user/update/${user.id}" target="dialog"
                       mask="true"
                       rel="switch_edit" title="修改人员信息">修改</a>
                </td>
            </tr>
        </c:forEach>

        </tbody>
    </table>
    <!--
<div class="panelBar">
    <div class="pages">
        <span>显示</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="200">200</option>
        </select>
        <span>条，共${totalCount}条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="200" numPerPage="20" pageNumShown="10" currentPage="1"></div>
</div>
-->
</div>
